package toster;
import java.util.ArrayList;

public class ThreadManager {
    private ArrayList<Thread> manager = new ArrayList<Thread>();
    
    public ThreadManager() {}

    void add(Thread in) {
        if (Runtime.getRuntime().freeMemory() > 1000) {
            manager.add(in);
        }
    }

    void remove(int in) {
        manager.get(in).interrupt();
    }
}
